<?php
// Saves plan of study for a specific student.

session_start();
if ( ! isset( $_SESSION['studentLoggedIn'] ) ) {
   exit;
}

require_once("db.php");

// Is there data coming in?
if ( isset($_POST['primaryKey'] ) ) {
   
   $primaryKey = $_POST['primaryKey'];
   $xmlData = $_POST['plan'];
   $allowableCourses = $_POST['allowable'];
   
   $sql = "
      UPDATE gs_plans
      SET xml='$xmlData', allowable='$allowableCourses'
      WHERE student_id='$primaryKey'
   ";
     
   my_mysql_query($sql);

   echo "<answer>ok</answer>";
}
?>